package com.banggood.upms.dao;

import com.banggood.upms.bean.po.User;
import com.banggood.upms.bean.vo.UpmsCredentials;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface UserDao extends BaseDao<User>{

    /**
     * 根据账号搜索未删除用户
     * @param accountName
     * @return
     */
    User selectByAccount(String accountName);

    /**
     * 根据ID集合,搜索用户
     * @param ids
     * @return
     */
    List<User> selectByPrimaryKeys(List<String> ids);

    /**
     * 返回用户ID
     * @param credentials
     * @return
     */
    String login(UpmsCredentials credentials);

    /**
     * 登录成功之后，更新登录信息
     * @return
     * @param upmsCredentials
     */
    int updateLoginInfo(UpmsCredentials upmsCredentials);
}